package com.uphone.kingmall.activity.personal;

import android.widget.ImageView;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.china.zhuoyue.R;
import com.flyco.tablayout.SlidingTabLayout;
import com.uphone.kingmall.adapter.MyPagerAdapter;
import com.uphone.kingmall.base.BaseActivity;
import com.uphone.kingmall.fragment.my.LiuYanFragment;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * <pre>
 *     author : 王雨
 *     e-mail : sunzengyan@outlook.com
 *     time   : 2018/07/31
 *     desc   :留言 投诉
 *     version: 1.0
 * </pre>
 */
public class LiuYanActivity extends BaseActivity {
    @BindView(R.id.iv_back)
    ImageView ivBack;
    @BindView(R.id.tab_layout)
    SlidingTabLayout tabLayout;
    @BindView(R.id.vp_page)
    public ViewPager vpPage;
    private final String[] mTitles = {"留言", "投诉"/*, "回复记录"*/};
    private MyPagerAdapter mAdapter;
    private ArrayList<Fragment> mFragments = new ArrayList<>();

    @Override
    public int getLayoutContentId() {
        return R.layout.kingmall_activity_liuyan;
    }

    @Override
    public void initView() {
        setStatusBar();
        mFragments.clear();
        mFragments.add(LiuYanFragment.getInstance(mTitles[0],0));
        mFragments.add(LiuYanFragment.getInstance(mTitles[1],1));
//        mFragments.add(LiuYanReplyFragment.newInstance());

        mAdapter = new MyPagerAdapter(getSupportFragmentManager(), mFragments, mTitles);
        vpPage.setAdapter(mAdapter);
        tabLayout.setViewPager(vpPage);
//        vpPage.setOffscreenPageLimit(2);

    }

    @Override
    public void initData() {

    }

    @OnClick(R.id.iv_back)
    public void onViewClicked() {
        finish();
    }
}
